//
//  Adapter.m
//  iOS-BTong-Common
//
//  Created by maqz on 2018/3/20.
//  Copyright © 2018年 xiaofeiZhang. All rights reserved.
//

#import "FBAdapter.h"

@implementation FBAdapter

+ (CGFloat)adapterFloat:(CGFloat)value {
    return value * [FBAdapter adapterScale];
}

+ (UIFont *)adapterFontWithSize:(CGFloat)size {
    return [UIFont systemFontOfSize:size * [FBAdapter adapterScale]];
}

+ (UIFont *)adapterFontWithSize:(CGFloat)size weight:(UIFontWeight)weight {
    if (@available(iOS 8.2, *)) {
        return [UIFont systemFontOfSize:size * [FBAdapter adapterScale] weight:weight];
    }
    else {
        return [FBAdapter adapterFontWithSize:size];
    }
}

+ (CGFloat)adapterScale {
    CGFloat scale = CGRectGetWidth([UIScreen mainScreen].bounds) / 375.0;
    return scale;
}
@end
